from flask import Flask,render_template,request,redirect,send_file
import os
import plateNoRegPy

app = Flask(__name__)

# 设置配置
UPLOAD_FOLDER = os.path.join(app.root_path, 'static', 'img')
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
SOURCE_FOLDER = os.path.join(app.root_path, 'static', 'src')
app.config['SOURCE_FOLDER'] = SOURCE_FOLDER
# 注册路由和其他配置
app.register_blueprint(plateNoRegPy.blueprint)  # 车牌图片识别蓝图注册

@app.route('/src/<path:path>')#网页的所有文件都是来自服务器
def send_image(path):
    return send_file(path, mimetype='image/jpeg')

@app.route('/')
def hello_world():  # put application's code here
    return redirect('/plateReg')#跳转车牌识别
    return 'Hello World!'


if __name__ == '__main__':
    # app.run()
    app.run(host='0.0.0.0', port=8000)
